﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IRPG
{
    class MagicSword : IWeapon
    {
        Random random = new Random();
        public void Attack(Monster monster)
        {
            //monster.HP -= random.NextDouble() < 0.5 ? 100 : 200;
            //monster.Notify();
            //Console.WriteLine("攻击成功!HP剩下{0}", monster.HP);

            int loss = random.NextDouble() < 0.5 ? 100 : 200;
            if (loss == 200)
                Console.WriteLine("出现暴击！");
            monster.Notify(loss);
        }
    }
}
